﻿using FieldTools.MyQQ.Core.HttpAPI;
using FieldTools.Util;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace FieldTools.Client.Business.Util
{
    public static class UtilHttpApi
    {
        /// <summary>
        /// 获取淘宝买家秀
        /// </summary>
        /// <returns></returns>
        public static async Task<string> GetBuyersShow()
        {
            var res = HttpHelper.GetData("https://api.uomg.com:443/api/rand.img3?sort=%E8%83%96%E6%AC%A1%E7%8C%AB&format=json", null, null);
            //BuyersShow buyersShow = res.ToObject<BuyersShow>();
            var imgurl = res.GetJsonNode("[imgurl]");
            var code = res.GetJsonNode("[code]");
            if (code == "1")
            {
                //MyqqHttpApi myqqHttpApi = new(info.Posturl, info.Token);
                //string url = imgurl;
                return imgurl.Replace(" ", string.Empty).Replace(@"\", string.Empty);
                //await SendMsgConver(myqqpost, myqqHttpApi, $"[pic={imgurlCh}]");

                //return url;
            }
            return string.Empty;
        }
    }
}
